package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
    /**
     * 插入菜品口味数据
     * @param flavors
     */
    @AutoFill(OperationType.INSERT)
    void insertDishFlavor(List<DishFlavor> flavors);

    /**
     * 更改口味
     * @param flavor
     * @return
     */
    @AutoFill(OperationType.UPDATE)
    void update(DishFlavor flavor);

    /**
     * 根据菜品id查询
     * @param id
     * @return
     */
    List<DishFlavor> list(Long id);

    /**
     * 根据菜品id删除
     * @param id
     */
    void deleteByDishId(Long id);

    /**
     * 插入
     * @param flavor
     */
    void insert(DishFlavor flavor);
}
